<template>
    <div>
      <div id="map" :style="{ height: h + 'px', width: w}"></div>
      <back :scroll="false"></back>
    </div>
</template>

<script>
import AMap from 'AMap'
import back from '../../components/base/back.vue'
export default {
  name: 'shop-map',
  comments: 'shop-map',
  components: {
    back
  },
  props: {
  },
  data () {
    return {
      w: window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth + 'px',
      h: window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight + 'px'
    }
  },
  created () {
    document.title = '地理位置'
  },
  mounted () {
    var map = new AMap.Map('map', {
      center: [this.$route.params.latitude, this.$route.params.longitude],
      resizeEnable: true,
      zoom: 10
    })
    AMap.plugin(['AMap.ToolBar', 'AMap.Scale'], function () {
      map.addControl(new AMap.ToolBar())
      map.addControl(new AMap.Scale())
    })
  },
  methods: {
  }
}
</script>
<style lang="postcss" scoped>
</style>
